home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Examples / Internet Assistant.as < prev    next >
Encoding:
Text File  |  1998-01-12  |  10.2 KB  |  190 lines  |  [TEXT/ToyS]

  1. property dlogMain : {size:[383, 299], name:¬
  2.     "Internet Config Assistant", closeable:true, style:standard window, contents:[¬
  3.     {class:icon push button, bounds:[322, 274, 342, 293], contents:1000, style:5, enabled:false}, ¬
  4.     {class:icon push button, bounds:[357, 274, 377, 293], contents:1001, style:5}, ¬
  5.     {class:group box, bounds:[-1, -1, 384, 22]}, ¬
  6.     {class:group box, bounds:[-1, 268, 384, 300]}, ¬
  7.     {class:static text, bounds:[342, 278, 357, 298], justification:center, font:5, contents:1}, ¬
  8.     {class:static text, bounds:[16, 4, 360, 19], font:5, contents:""} ¬
  9.         ]}
  10. property dlogSaveChanges : {size:[400, 110], contents:[¬
  11.     {class:push button, bounds:[330, 80, 390, 100], name:"Save"}, ¬
  12.     {class:push button, bounds:[260, 80, 320, 100], name:"Cancel"}, ¬
  13.     {class:push button, bounds:[68, 80, 158, 100], name:"Don’t Save"}, ¬
  14.     {class:icon, bounds:[13, 10, 45, 42], contents:2}, ¬
  15.     {class:static text, bounds:[68, 10, 390, 58], font:1, contents:"Save changes before quiting?"}]}
  16. property dTitle : [¬
  17.     "Introduction", "Personal Information", "Geographic Location", ¬
  18.     "E-mail Address and Password", "E-mail Account and Host Computer", ¬
  19.     "Signature", "World Wide Web Home Page", "Newsgroup Host Computer", "Conclusion"]
  20. property dValue : [¬
  21.     null, ¬
  22.     ["<user name>", "<organization>"], ¬
  23.     1, ¬
  24.     ["<email>", "<password>"], ¬
  25.     ["<email account>", "<SMTP host>"], ¬
  26.     ["<signature>"], ¬
  27.     ["<home page>"], ¬
  28.     ["<NNTP host>"], ¬
  29.     null ¬
  30.         ]
  31. property dRegion : ["United Kingdom", "Europe", "North America", "South America", "Africa", "Asia", "Austrailia"]
  32. property dPage : [¬
  33.     [¬
  34.         {class:static text, bounds:[16, 31, 343, 73], contents:"This assistant asks you some questions to help you make some basic settings for your Internet connections."}, ¬
  35.         {class:static text, bounds:[15, 69, 320, 102], contents:"Specifically, the assistant will set up your Internet browsing, electronic mail, and newsgroup connections."}, ¬
  36.         {class:static text, bounds:[16, 107, 334, 166], contents:"If you subscribe to an online service (for example America Online) you will have to set up that service separately."} ¬
  37.             ], ¬
  38.     [¬
  39.         {class:text field, bounds:[32, 113, 292, 129]}, ¬
  40.         {class:text field, bounds:[32, 164, 292, 180]}, ¬
  41.         {class:static text, bounds:[16, 93, 216, 107], font:5, contents:"What is your name?"}, ¬
  42.         {class:static text, bounds:[16, 144, 311, 159], font:5, contents:"What is your company or organization?"}, ¬
  43.         {class:static text, bounds:[17, 32, 302, 79], contents:"Your name and company or organization are used by your Internet browsing and e-mail programs to help identify you to the people you send e-mail to and (when you choose to) to others on the Internet."} ¬
  44.             ], ¬
  45.     [¬
  46.         {class:pict, bounds:[12, 71, 372, 249], contents:300}, ¬
  47.         {class:static text, bounds:[16, 31, 370, 43], font:5, contents:"Where are you located?"}, ¬
  48.         {class:static text, bounds:[16, 43, 370, 65], contents:"Click on your approximate location."}, ¬
  49.         {class:poly radio button, bounds:[12, 71, 372, 249], contents:[175, 29, 178, 29, 182, 40, 175, 42, 175, 30]}, ¬
  50.         {class:poly radio button, bounds:[184, 89, 235, 126]}, ¬
  51.         {class:poly radio button, bounds:[29, 90, 142, 146], contents:[0, 0, 93, 0, 113, 24, 62, 56, 30, 20, 0, 14, 0, 0]}, ¬
  52.         {class:poly radio button, bounds:[100, 146, 162, 235], contents:[0, 0, 32, 4, 53, 17, 60, 20, 60, 25, 32, 72, 17, 70, 21, 34, 12, 19, 14, 10, 0, 0]}, ¬
  53.         {class:poly radio button, bounds:[176, 122, 255, 200]}, ¬
  54.         {class:poly radio button, bounds:[230, 80, 355, 172]}, ¬
  55.         {class:poly radio button, bounds:[305, 171, 347, 210]} ¬
  56.             ], ¬
  57.     [¬
  58.         {class:text field, bounds:[32, 102, 292, 118]}, ¬
  59.         {class:text field, bounds:[32, 185, 292, 201]}, ¬
  60.         {class:static text, bounds:[16, 31, 353, 74], contents:"The next few questions are about e-mail settings. If you do not know the answers to any of these questions, ask your system administrator or e-mail account provider."}, ¬
  61.         {class:static text, bounds:[16, 82, 363, 97], font:5, contents:"What is your e-mail address?"}, ¬
  62.         {class:static text, bounds:[16, 165, 375, 180], font:5, contents:"What is your e-mail password?"}, ¬
  63.         {class:static text, bounds:[28, 209, 350, 242], contents:"If you leave your password blank, you will have to enter your password when you want to receive mail."}, ¬
  64.         {class:static text, bounds:[28, 126, 357, 154], contents:"This address serves as the return address for messages that you send, and it is where people will send you e-mail."} ¬
  65.             ], ¬
  66.     [¬
  67.         {class:text field, bounds:[32, 89, 292, 105]}, ¬
  68.         {class:text field, bounds:[32, 171, 292, 187]}, ¬
  69.         {class:static text, bounds:[16, 31, 371, 58], contents:"Again, if you do not know the answers to any of these questions, ask your system administrator or e-mail account provider."}, ¬
  70.         {class:static text, bounds:[16, 150, 339, 164], font:5, contents:"Which computer serves as your e-mail host?"}, ¬
  71.         {class:static text, bounds:[29, 113, 357, 138], contents:"Your e-mail account, also called your POP (Post Office Protocol) account, is the place where you receive your mail."}, ¬
  72.         {class:static text, bounds:[29, 195, 354, 234], contents:"Usually called the SMTP (Simple Mail Transfer Protocol) host, this computer is where you send your outgoing e-mail."}, ¬
  73.         {class:static text, bounds:[16, 68, 295, 83], font:5, contents:"What is your e-mail account?"} ¬
  74.             ], ¬
  75.     [¬
  76.         {class:text field, bounds:[15, 101, 371, 168]}, ¬
  77.         {class:static text, bounds:[16, 31, 373, 70], contents:"You can automatically add text to the end of your e-mail messages and other Internet correspondence. The text usually contains your name, address, telephone number, e-mail address, or a favorite quotation."}, ¬
  78.         {class:static text, bounds:[14, 81, 320, 96], font:5, contents:"What text would you like added automatically?"}, ¬
  79.         {class:static text, bounds:[28, 172, 374, 191], contents:"If you do not want any text added, leave this space blank."} ¬
  80.             ], ¬
  81.     [¬
  82.         {class:text field, bounds:[32, 88, 292, 104]}, ¬
  83.         {class:static text, bounds:[16, 31, 372, 57], contents:"When you open your World Wide Web browser program, the Web site that you assign as your home page appears first."}, ¬
  84.         {class:static text, bounds:[16, 68, 368, 84], font:5, contents:"Which Web site do you want to make your home page?"}, ¬
  85.         {class:static text, bounds:[29, 113, 369, 159], contents:"Web site addresses usually start with “www” followed by a period and the rest of the address; for example “www.apple.com”."} ¬
  86.             ], ¬
  87.     [¬
  88.         {class:text field, bounds:[36, 89, 296, 105]}, ¬
  89.         {class:static text, bounds:[16, 32, 376, 64], contents:"Newsgroups are an Internet service that allows you to read or join ongoing discussions with other people on a wide range of subjects."}, ¬
  90.         {class:static text, bounds:[16, 69, 366, 85], font:5, contents:"Which computer serves as your newsgroup host?"}, ¬
  91.         {class:static text, bounds:[33, 112, 352, 152], contents:"If you do not know the answer to this question, ask your Internet service provider or network administrator."} ¬
  92.             ], ¬
  93.     [¬
  94.         {class:push button, bounds:[296, 238, 371, 258], name:"Go Ahead"}, ¬
  95.         {class:push button, bounds:[210, 238, 285, 258], name:"Cancel"}, ¬
  96.         {class:push button, bounds:[16, 238, 110, 258], name:"Show Details"}, ¬
  97.         {class:static text, bounds:[16, 32, 353, 80], contents:"Based on your answers, this assistant is ready to set up your basic Internet browsing, e-mail, and newsgroup connections."}, ¬
  98.         {class:static text, bounds:[16, 57, 140, 230], font:5, contents:""}, ¬
  99.         {class:static text, bounds:[140, 57, 500, 230], contents:""}, ¬
  100.         {class:static text, bounds:[140, 57 + 72, 500, 57 + 120], contents:""} ¬
  101.             ] ¬
  102.         ]
  103. property noDetails : "This assistant is ready to create an Internet preferences file with the following information:"
  104. property detailNames : "Name:
  105. Organization:
  106. E-mail address:
  107. E-mail password:
  108. E-mail (POP) account:
  109. E-mail (SMTP) host:
  110. Signature:
  111.  
  112.  
  113.  
  114. WWW Home Page:
  115. Newsgroup host:
  116. Default FTP servers:"
  117.  
  118. global d, doQuit, page
  119. -- Fonts: System, Control, Label, Data, …
  120. dd install with fonts [null, null, {name:"Geneva", size:9}, null, {name:"Geneva", size:9, style:bold}] with grayscale
  121. set d to dd make dialog dlogMain
  122. set doQuit to false
  123. set page to 0
  124. set showDetails to true
  125. GoPage(1)
  126. repeat until doQuit
  127.     set i to dd interact with user
  128.     if i = -1 then -- Close box
  129.         set doQuit to not (dd auto dialog dlogSaveChanges)'s item 2
  130.     else if i = 1 then -- Prev
  131.         GoPage(page - 1)
  132.     else if i = 2 then -- Next
  133.         GoPage(page + 1)
  134.         set showDetails to true
  135.     else if page = dPage's length then
  136.         if i = 7 then -- Go Ahead
  137.             --
  138.             --    Should use Internet Config to apply settings
  139.             --
  140.             beep 1
  141.             set doQuit to true
  142.         else if i = 8 then -- Cancel
  143.             beep 2
  144.             set doQuit to true
  145.         else if showDetails then -- Show details
  146.             dd set name of dialog item 9 of d to "Hide Details"
  147.             tell dValue to set v to item 2's item 1 & return & item 2's item 2 & return ¬
  148.                 & item 4's item 1 & return & item 4's item 2 & return ¬
  149.                 & item 5's item 1 & return & item 5's item 2 & return & return & return & return & return ¬
  150.                 & item 7's item 1 & return ¬
  151.                 & item 8's item 1 & return & dRegion's item (item 3) --"<location>"
  152.             dd set contents of dialog items 10 thru 13 of d to [noDetails, detailNames, v, dValue's item 6's item 1]
  153.             set showDetails to false
  154.         else -- Hide details
  155.             dd set name of dialog item 9 of d to "Show Details"
  156.             dd set contents of dialog items 10 thru 13 of d to [dPage's item -1's item 4's contents, "", "", "", ""]
  157.             set showDetails to true
  158.         end if
  159.     end if
  160. end repeat
  161. dd uninstall
  162.  
  163. on GoPage(n)
  164.     if page ≠ 0 then
  165.         if page = 3 then
  166.             set vs to dd get value of dialog items 10 thru -1 of d
  167.             repeat with j from 1 to vs's length
  168.                 if vs's item j then
  169.                     set dValue's item page to j
  170.                     exit repeat
  171.                 end if
  172.             end repeat
  173.         else
  174.             set vs to dValue's item page
  175.             if vs ≠ null then set dValue's item page to dd get value of dialog items 7 thru (6 + (vs's length)) of d
  176.         end if
  177.         dd delete dialog items 7 thru -1 of d
  178.     end if
  179.     dd set enabled of dialog items 1 thru 2 of d to [n > 1, n < dPage's length]
  180.     dd set contents of dialog items 5 thru 6 of d to [n, dTitle's item n]
  181.     dd make (dPage's item n) at d
  182.     set vs to dValue's item n
  183.     if n = 3 then
  184.         --dd set value of dialog item 9 of d to 0
  185.         dd set value of dialog item (9 + vs) of d to (true)
  186.     else if vs ≠ null then
  187.         dd set value of dialog items 7 thru (6 + (vs's length)) of d to vs
  188.     end if
  189.     set page to n
  190. end GoPage